import request from '@/utils/request.js'
import {useTokenStore} from "@/stores/token.js";

//文章分类列表查询
export const articleCategoryListService = ()=>{
    return request.get('/category');
}

//文章分类添加
export const articleCategoryAddService = (categoryData)=>{
    return request.post("/category",categoryData);
}

//文章分类修改
export const articleCategoryUpdateService = (categoryDate)=>{
    return request.put('/category',categoryDate);
}
//文章分类的删除
export const articleCategoryDeleteServe = (id)=>{
    return request.delete('/category?id='+id);
}
//获取所有文章
export const articleListService = (params)=>{
    return request.get('/article',{params:params});
}
//文章添加函数
export const articleAddService = (articleData)=>{
    return request.post('/article',articleData);
}
//文章编辑函数
export const articleUpdateService = (updateDate)=>{
    return request.put('/article',updateDate);
}
//文章删除函数
export const deleteArticleService = (id)=>{
    return request.delete('/article?id='+id);
}
